<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Team extends Model
{
    protected $fillable = [
        'name',
        'avatar',
        'description',
        'uuid',
        'discount',
        'free_times'
    ];

    public function users()
    {
        return $this->hasMany(User::class, 'team_id');
    }

    public function teamLeader()
    {
        return $this->hasOne(TeamLeader::class, 'team_id');
    }
    public function applies()
    {
        return $this->hasMany(Apply::class, 'team_id');
    }
}
